//
//  InsuHeadSmallV.m
//  carcareIOS
//
//  Created by 王然 on 16/7/26.
//  Copyright © 2016年 chezheng. All rights reserved.
//

#import "InsuHeadSmallV.h"
@interface InsuHeadSmallV()

@property (nonatomic , strong) UIImageView * iconIV;//小cell上面的icon
@property (nonatomic , strong) UILabel * titleL;//小cell上面的标题

@property (nonatomic , copy) void (^questionBtnClick)();

@end

@implementation InsuHeadSmallV

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        CGFloat lableX = 15 * __MAIN_RATIO_375;
        UIImage * iconImage = ImageNamed(@"willTestPolicyImage");
        
        self.iconIV = [[UIImageView imageViewWithFrame:CGRectMake((__MAIN_WIDTH - iconImage.size.width) / 2, 28, iconImage.size.width, iconImage.size.height) image:nil] setupOnView:self];
        
        self.titleL = [[UILabel labelWithFrame:CGRectMake(lableX, self.iconIV.bottom + 15 * __MAIN_RATIO_375, __MAIN_WIDTH - lableX * 2, 20) font:FONT_DEFAULT_Light(14) text:@"" textColor:COLOR_HEXSTRING(@"#B0B0B0")] setupOnView:self];
        [self.titleL setTextAlignment:NSTextAlignmentCenter];
        
//        __weak __typeof(self) wself = self;
#warning 问号按钮 勿删除
//        UIImage * questionImage = ImageNamed(@"insuranceQuestionImage");
//        [[UIButton buttonWithFrame:CGRectMake(__MAIN_WIDTH - questionImage.size.width - 15, 10, questionImage.size.width, questionImage.size.height) normalImage:questionImage click:^{
//            if (wself.questionBtnClick) wself.questionBtnClick();
//        }] setupOnView:self];
    }
    return self;
}
- (void)reloadIconImage:(UIImage *)image title:(NSString *)title questionBtnClick:(void(^)())questionBtnCilck
{
    [self.iconIV setImage:image];
    [self.titleL setText:title];
    if (questionBtnCilck) self.questionBtnClick = questionBtnCilck;
}
@end
